//非截停作用的BP变价，非鲜食部门，截停注释中非新原价促销活动ARTR，生效日非周日至周三，
//错误提示:非鲜食部门,(80,81,98 也算是非鲜食)BP生效日应为周日到周三
var result = JSON.parse('{"CODE":0, "ACTION":"","LEVEL":"", "MSG":"","DATA":"","RULE":"41"}');
var JSON_CSRL_LIST = !isNull(CSRL)?JSON.parse(find_Item_inCSRL(ITEM_NBR, CSRL)):[];
var D1 = NEW_RETAIL_EFF_DATE;
var D2 = NEW_RETAIL_EXP_DATE;
//判断此BP是否截停了CSRL中的促销
function BPSuspend(TRAIT_STORE_NBR, LIST, D1, D2) {
  for (var i = 0; i < LIST.length; i++) {
    if (isDateIntersection(LIST[i].EFFECTIVE_DATE, LIST[i].EXPIRATION_DATE, D1, D2)
      && isARTR(LIST[i].PRICE_TYPE)) {
      return true;
    }
  }
}

if (RETAIL_TYPE == 'BP') {
  if (!BPSuspend(TRAIT_STORE_NBR, JSON_CSRL_LIST, D1, D2)
    && !ispartFresh(DEPT_NBR)
    //&& SUSPEND_ARTR_COMMENT != '新原价促销活动ARTR'
    && new Date(D1).getDay() != 0
    && new Date(D1).getDay() != 1
    && new Date(D1).getDay() != 2
    && new Date(D1).getDay() != 3) {
    result.CODE = 2;
    result.ACTION = "CHECKING_REPORT";
    result.MSG = "非鲜食部门BP生效日应为周日到周三";
  }else if(BPSuspend(TRAIT_STORE_NBR, JSON_CSRL_LIST, D1, D2)
    && SUSPEND_ARTR_COMMENT != '新原价促销活动ARTR'
    && new Date(D1).getDay() != 0
    && new Date(D1).getDay() != 1
    && new Date(D1).getDay() != 2
    && new Date(D1).getDay() != 3
  ){
    result.CODE = 2;
    result.ACTION = "CHECKING_REPORT";
    result.MSG = "BP截停，生效日应为周日到周三，或者在截停注释中选 新原价促销活动ARTR";
  }
} 
JSON.stringify(result);

   